<?php
require_once 'PHPUnit/Framework.php';

require_once dirname(__FILE__).'/../../../KenDon.php';

class Test_KenDon extends PHPUnit_Framework_testCase{

    // <<test:testKenDonClassExists>>
        public function testKenDonClassExists(){
          $this->assertEquals(true, class_exists( 'KenDon' ) );
        }
    // -- end -- <<test:testKenDonClassExists>>

    // <<test:testKenDonLoadMethodExists>>
        public function testKenDonLoadMethodExists(){
          $this->assertEquals(true,   method_exists(KenDon, 'load') );
        }
    // -- end -- <<test:testKenDonLoadMethodExists>>

    // <<test:testLoadClasses>>
        public function testLoadClasses(){
          $this->assertEquals(true, KenDon::load('QTree') );
          $this->assertEquals( true, class_exists('KD_QTree') );
        }
    // -- end -- <<test:testLoadClasses>>

    // <<test:testLoadAdapter>>
        public function testLoadAdapter(){

          $this->assertEquals( true, KenDon::load('DB_PDO', 'adapter') );
          $this->assertEquals( false, KenDon::load('', 'adapter'));

        }
    // -- end -- <<test:testLoadAdapter>>

    // <<test:testLoadAPI>>
        public function testLoadAPI(){
          $this->assertEquals(false, KenDon::load( '', 'api' ) );
          $this->assertEquals(true,  KenDon::load( 'DB', 'api' ) );
          $this->assertEquals(true, KenDon::load('Model', 'api') );
        }
    // -- end -- <<test:testLoadAPI>>

    // <<test:testLoadLib>>
        public function testLoadLib(){
          //$this->assertEquals(true, KenDon::load('test/test', 'lib', 'test.php') );
        }
    // -- end -- <<test:testLoadLib>>

}
